// Definitions for interface to DttSp DSP

import std.typecons;

Tuple!(float, float)[string] A_RX_FILT;
int[string ] A_MODE;


//================================================================
// Modes
// As defined for DttSp
enum E_MODE
{
  LSB,				//  0
  USB,				//  1
  DSB,				//  2
  CWL,				//  3
  CWU,				//  4
  FMN,				//  5
  AM,				//  6
  DIGU,				//  7
  SPEC,				//  8
  DIGL,				//  9
  SAM,				// 10
  DRM				// 11
};

//================================================================
// TX/RX Mode
enum TRX_MODE {
    RX,             // 0
    TX              // 1
}

// These need to be computed at runtime.
// static(this) will run axactly once the first time this module is loaded
static this() {

    // Associative array for translation
    A_MODE = [
        "LSB": E_MODE.LSB,
        "USB": E_MODE.USB,
        "DSB": E_MODE.DSB,
        "CWL": E_MODE.CWL,
        "CWU": E_MODE.CWU,
        "FMN": E_MODE.FMN,
        "AM": E_MODE.AM,
        "DIGU": E_MODE.DIGU,
        "SPEC": E_MODE.SPEC,
        "DIGL": E_MODE.DIGL,
        "SAM": E_MODE.SAM,
        "DRM": E_MODE.DRM
    ];


    //================================================================
    // Filters
    A_RX_FILT = [
        "6K0": tuple(cast(float)100.0, cast(float)6100.0),
        "4K0": tuple(cast(float)100.0, cast(float)4100.0),
        "2K7": tuple(cast(float)300.0, cast(float)3000.0),
        "2K4": tuple(cast(float)300.0, cast(float)2700.0),
        "2K1": tuple(cast(float)300.0, cast(float)2400.0),
        "1K0": tuple(cast(float)300.0, cast(float)1300.0),
        "500": tuple(cast(float)500.0, cast(float)1000.0),
        "250": tuple(cast(float)600.0, cast(float)850.0),
        "100": tuple(cast(float)700.0, cast(float)800.0)
    ];
}



